package com.gylang.pdf;

import freemarker.template.Template;
import freemarker.template.TemplateException;

import java.io.IOException;
import java.io.Reader;
import java.util.Locale;

/**
 * @author gylang
 * data 2022/1/14
 */
public interface ITemplateProcessor {
    Template getTemplate(String name) throws IOException;

    Template getTemplate(String name, Locale locale) throws IOException;

    Template getTemplate(String name, Locale locale, String encode) throws IOException;

    Template getTemplate(String name, Locale locale, String encode, boolean parseAsFTL) throws IOException;

    Template getTemplate(String name, Locale locale, String encode, boolean parseAsFTL, boolean ignoreMissing) throws IOException;

    Template createTemplate(String name, String source) throws IOException;

    Template createTemplate(String name, Reader reader, String encode) throws IOException;

    Template pushTemplate(String name, String source) throws IOException;


    boolean removeTemplate(String name);

    String render(String name, Object obj) throws IOException, TemplateException;

    String render(String name, String templateSource, Object obj) throws IOException, TemplateException;
}
